<head>
    <meta charset="utf8">
    <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
</head>

<body>
    <div id="myapp">
        {{count}} <button @click="click">
    </div>
</body>
<script>
    const app_data = {
        count: 0,
    };
    const method = {
        click() {
            this.count++;
        }
    };
    // 创建Vue实例时可以传入一个javascript对象来提供App创建时数据相关的配置项
    // data 或者 methods
    const instance = Vue.createApp({
        data() {
            return app_data;
        },
        methods: method
    })
    //用mount 挂载到html元素
    instance.mount("#myapp")
</script>